<template>
  <div class="container">
    
    <el-menu
    class="el-menu-demo"
    mode="horizontal"
    @select="handleSelect"
    background-color="#545c64"
    text-color="#fff"
    active-text-color="#ffd04b">

    <el-menu-item    style="margin-left:0%;"><h1  style="color:#fff;">数据分析与管理系统</h1></el-menu-item>

    <el-submenu  style="margin-left:70%;" index="0">

        
        <template slot="title">
        <div class="icon">
            <img src="../../imgs/icon.jpg" alt="">
            <p>{{manager_name}}</p>
        </div>        
        
        </template>
        <!-- <el-menu-item >修改密码</el-menu-item> -->
        <el-menu-item @click="exit">退出</el-menu-item>
    </el-submenu>
    </el-menu>
    <div class="bottom-box">
        <div class="side-box">
            <el-row>
            <el-col :span="4"  class="side">
                <el-menu default-active="2"
                class="el-menu-vertical-demo"
                background-color="#444"
                text-color="#fff"
                active-text-color="#ffd04b">
                <el-menu-item index="1">
                    <i class="tt">
                        <img src="../../imgs/persona.png" alt="">
                    </i>
                    <span slot="title"  @click="toGlobalPersona">总体用户画像</span>
                </el-menu-item>
                <!-- <el-submenu index="2" >
                    <template slot="title">
                    <i class="tt">
                        <img src="../../imgs/persona.png" alt="">
                    </i>
                    <span>用户管理</span>
                    </template>
                    <el-menu-item-group>
                    <el-menu-item index="2-1" @click="toManagePermissions">用户管理</el-menu-item>
                    <el-menu-item index="2-2" @click="showLogs">查看日志</el-menu-item>
                    </el-menu-item-group>
                </el-submenu> -->

                <el-menu-item index="3">
                    <i class="tt">
                        <img src="../../imgs/notice.png" alt="">
                    </i>
                    <span slot="title"  @click="toNotice">公告管理</span>
                </el-menu-item>
                <el-menu-item index="4">
                    <i class="tt">
                        <img src="../../imgs/sport.png" alt="">
                    </i>
                    <span slot="title"  @click="toSportParameters">运动收益管理</span>
                </el-menu-item>
                <!-- <el-menu-item index="5">
                    <i class="tt">
                        <img src="../../imgs/pet.png" alt="">
                    </i>
                    <span slot="title"  @click="toManagePetTemplate">宠物模板管理</span>
                </el-menu-item> -->
                <el-submenu index="5" >
                    <template slot="title">
                    <i class="tt">
                        <img src="../../imgs/pet.png" alt="">
                    </i>
                    <span>虚拟教练管理</span>
                    </template>
                    <el-menu-item-group>
                    <el-menu-item index="5-1" @click="toManagePetTemplate">查看与新增模板</el-menu-item>
                    <el-menu-item index="5-2" @click="toEditEvolutionLine">编辑进化线</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                <el-menu-item index="6">
                    <i class="tt">
                        <img src="../../imgs/market.png" alt="">
                    </i>
                    <span slot="title"  @click="toManageMarket">服装管理</span>
                </el-menu-item>
                <el-menu-item index="7">
                    <i class="tt">
                        <img src="../../imgs/persona.png" alt="">
                    </i>
                    <span slot="title"  @click="toManageArena">用户管理</span>
                </el-menu-item>
                </el-menu>
            </el-col>
            </el-row>
        </div>
    
        <div  class="main">
            <el-main>
                <router-view>
                </router-view>

            </el-main>
        </div>
    </div>
  </div>
</template>

<script>
  
  export default{
      data(){       
          return {
            manager_name:"tt",
            activeIndex: '1',
            show_side:false,
            is_manager:false
          }
      },
      mounted:function(){
       this.manager_name=this.$store.state.login_manager_name;
      },
      methods:{
        handleSelect(key, keyPath) {
            console.log(key, keyPath);
        },
        exit(){
            this.$router.push({path:'/login_manager'})
        },
        toNotice(){
            this.$router.push({path:"notice"})
        },
        toSportParameters(){
            this.$router.push({path:"sport_parameter"})
        },
        toManageUsers(){
            this.$router.push({path:'manage_users'})
        },
        toManagePermissions(){
            this.$router.push({path:'manage_permissions'})
        },
        toManagePetTemplate(){
            this.$router.push({path:'manage_pet_template'})
        },
        toGlobalPersona(){
            this.$router.push({path:'global_persona'})
        },
        toEditEvolutionLine(){
            this.$router.push({path:'edit_evolution_line'})
        },
        toManageMarket(){
            this.$router.push({path:'manage_market'})
        },
        toManageArena(){
            this.$router.push({path:'manage_arena'})
        },
        showLogs(){
            this.$router.push({path:'show_logs'})
        },
        toOther1(){
            this.$router.push({path:'other1'})
        }
      },

  }
</script>


<style lang="scss" scoped>

    .tt img{
        width: 30px;
        height: 30px;
    }
    .container{
        width: 100%;
    }
    .side-box{
        width: 16%;
    }
    .side{
        width: 100%;
        margin-top:-1%;
        min-height: 91vh;
        background: #444;
    }
    .bottom-box{
        display: flex;
    }
    .main{
        margin: 1% 2% 1% 2%;
        height: 85vh;
        overflow: scroll;
        border: 1px solid rgb(219, 214, 214);
        width: 90%;
    }
    .icon{
        display: flex;
        width: 80px;
        height: 80px;
    }
    .icon img{
        margin-top: 10%;
        margin-right: 11%;
        width: 40px;
        height: 40px;
        border-radius: 50px 50px;
    }
</style>
